
package net.atremmedia.gwt.actionjava.examples.basics.samples;

import net.atremmedia.gwt.actionjava.examples.AJExample;
import net.atremmedia.gwt.actionjava.examples.frame.AJExampleOverview;
import actionjava.display.Graphics;
import actionjava.display.Shape;

public class DrawPolyStar extends AJExample
{
	public static final String NAME = "Draw polystar";
	public static final String DESCRIPTION = "Description";
	public static final String EXAMPLE_SRC = "https://code.google.com/p/gwt-actionjava/source/browse/trunk/aj-examples/aj-examples-basics/src/main/java/net/atremmedia/gwt/actionjava/examples/basics/samples/DrawPolyStar.java";

	public DrawPolyStar(AJExampleOverview base)
	{
		super(NAME, DESCRIPTION, EXAMPLE_SRC, base);
	}

	@Override
	public void run()
	{
		Shape circle = new Shape();
		circle.setX(25);
		circle.setY(25);

		Graphics graphs = circle.getGraphics();
		graphs.beginFill(getRandomColor());
		graphs.drawPolyStar(50, 50, 50, 5, 1, 0);
		graphs.endFill();

		addChild(circle);
	}
}
